//
//  CustomSmallScrollView.m
//  UI06_homework2
//
//  Created by aaaaaa on 16/6/13.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "CustomSmallScrollView.h"

@implementation CustomSmallScrollView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (instancetype)initWithFrame:(CGRect)frame withImage:(UIImage *)image{
    self = [super initWithFrame:frame];
    if (self) {
        [self setProperty:image];
    }
    return self;
}

- (instancetype)initWithImage:(UIImage *)image{
    
    self = [super init];
    if (self) {
        [self setProperty:image];
    }
    
    return self;
}

- (void)setProperty:(UIImage *)image{
    self.contentSize = self.bounds.size;
    self.scrollEnabled = NO;
    self.bounces = NO;
    self.showsVerticalScrollIndicator = NO;
    self.showsHorizontalScrollIndicator = NO;
    self.minimumZoomScale = 0.5;
    self.maximumZoomScale = 2.0;
    UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
    imageView.userInteractionEnabled = NO;
    imageView.frame = self.bounds;
    [self addSubview:imageView];
    [imageView release];
    
}


@end
